<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Fee_driver extends Authenticated_Controller{
	
	function __construct() {
		parent::__construct();
		$this->load->model('fee_driver_model','fee');
		$this->data['opt']=$this->fee->get_asal_tujuan();
	}
	
	function index(){
		$this->list_fee();
	}
	
	function list_fee(){
		$data['daftar_fee'] = $this->fee->get_all();
		$this->load->view('template/header_view');
		$this->load->view('fee_driver/daftar_fee',$data);
		$this->load->view('template/footer_view');
	}
	
	function form_add_fee(){
		$data['daftar_asal_tujuan'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('fee_driver/form_add_fee',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_add_fee(){
		$this->fee->insert_new($_POST);
		redirect(FEE);
	}
	
	function process_delete_fee($id){
		$this->fee->delete_old($id);
		redirect(FEE);
	}
	
	function form_edit_fee($id){
		$data = $this->fee->get_one($id);
                $data['daftar_asal_tujuan'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('fee_driver/form_edit_fee',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_edit_fee($id){
		$this->fee->update_old($id,$_POST);
		redirect(FEE);
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
